﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using RFinance.Domain.Entities;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace RFinance.Domain.Concrete
{
    public class RFinanceContext : DbContext
    {
        public RFinanceContext() : base("ApplicationServices") { }
        private DbSet<User> Usuarios { get; set; }
        private DbSet<Agencia> Agencias { get; set; }
        private DbSet<Banco> Bancos { get; set; }
        private DbSet<Categoria> Categorias { get; set; }
        private DbSet<Conta> Contas { get; set; }
        private DbSet<Subcategoria> Subcategorias { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<RFinanceContext, Configuration>());
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }


}
